﻿@{
    ViewBag.Title = "Đất Nước Việt";
    Layout = "~/Views/Shared/_Layout.cshtml";

    List<DatNuocViet.Models.NewsType> ListNewsType = ViewBag.listNewsType as List<DatNuocViet.Models.NewsType>;

    string lang = (Session["Language"] == null) ? "vi" : Session["Language"].ToString();
}
@section script_arena
{
    <script type="text/javascript">
        var nFeaturedToursPage = (@ViewBag.nFeaturedTours + 3 - 1) / 3;
        var featuredToursIndex = 1;

        function loadFeaturedTours() {
            //alert("Hello");
            featuredToursIndex++;

            if (featuredToursIndex > nFeaturedToursPage) {
                featuredToursIndex = 1;
            }

            $.ajax({
                cache: false,
                data: { page: featuredToursIndex },
                url: '@Url.Action("FeaturedTours", "Home")',
                success: function (result) {
                    $("#Featured_tour").hide().html(result).fadeIn(3000,'swing');
                }
            });
        }
        $(document).ready(function () {
            setInterval(loadFeaturedTours, 10000);
        });
    </script>
}

@section Featured_tour
{
    <a class="left-button-extra" href="#">Nổi bật</a>
    <div class="wrapper" id="Featured_tour" style="height:325px">
        @{Html.RenderAction("FeaturedTours", "Home", new { page = 1 });}
    </div>
}

@section tourArea1
{
    @foreach (var item in DatNuocViet.Models.ToursDAO.getTourType())
    {
        if(DatNuocViet.Models.ToursDAO.getAmountOfToursByType(item.Id) > 0)
        {
            <h2 class="subtitle">@if (lang == "en") { @Html.Raw(item.TourTypeEn); } else { @Html.Raw(item.TourTypeVn); }</h2>
            Html.RenderAction("listTours", "Home", new { type = item.Id });
            <div class="std"><div class="clear"></div></div>    
        }
    }
}

@section news_area
{
	<div class="news_tabs">
	<!--<div class="news_main_title">Tin tức & Sự Kiện</div>-->
		<ul class="idTabs">
	    @for (int i = 0; i < ListNewsType.Count; i++)
        {
           string tab = "tab_" + ListNewsType[i].SortOrder.ToString();
           string style = "";
           if (i == 0)
           {
               style = "margin-left: 10px;";
           }
            <li style="@style"><a class="tabs" href="#@tab">
            @if (lang == "en")
            {
                @Html.Raw(ListNewsType[i].NewsTypeEn);
            }
            else
            {
                @Html.Raw(ListNewsType[i].NewsTypeVn);
            }
            </a></li>
        }
		</ul>
				
	</div>

    @foreach (var item in ListNewsType)
    {
        Html.RenderAction("newsContent", "Home", new { type = item.Id });
    }
}